package com.example.emp20221871luhaotian.demos.service.impl;

import com.example.emp20221871luhaotian.demos.mapper.EmpMapper;
import com.example.emp20221871luhaotian.demos.po.Emp;
import com.example.emp20221871luhaotian.demos.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author lht
 * @version 1.0
 * @since 2025/6/3
 */
@Service
public class EmpServiceImpl implements EmpService {

    @Autowired
    private EmpMapper empMapper;

    @Override
    public List<Emp> findAllEmp() {
        return empMapper.findAllEmp();
    }

    @Override
    public int addEmp(Emp emp) {
        return empMapper.insertEmp(emp);
    }

    @Override
    public int updateEmp(Emp emp) {
        return empMapper.updateEmp(emp);
    }

    @Override
    public int deleteEmp(Integer id) {
        return empMapper.deleteById(id);
    }

    @Override
    public Emp getById(Integer id) {
        return empMapper.findEmpById(id);
    }

    @Override
    public List<Map<String, Object>> getAllSalary() {
        return empMapper.getAllSalary();
    }
}
